aboutsummaryrefslogtreecommitdiff
path: root/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:canCaptureFreeVariablesThatAreSetAfterDefinition(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
blob: 2f63a85207322cac18050933ea2eb8189b9bc316 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Compilation unit elements:

(
    function
    "shed__function__f__0"
    visibility=private
    params=(("closurePointer__0" data-ptr))
    locals=(("local__a" int) ("local__b" int))
    return-type=int
    body=(
        (
            memory-load
            (local "local__a")
            pointer=(local "closurePointer__0")
            layout=(struct (function-ptr (struct (int int))))
            offset=(1 0)
        )
        (
            memory-load
            (local "local__b")
            pointer=(local "closurePointer__0")
            layout=(struct (function-ptr (struct (int int))))
            offset=(1 1)
        )
        (return (local "local__a"))
    )
)

Locals:
 * ("closure__f__0" int)
 * ("closurePointer__f__0" data-ptr)
 * ("local__a" int)
 * ("local__b" int)

Args:
 * local__a
 * local__b

Instructions:

(
    (alloc (local "closurePointer__f__0") (struct (function-ptr (struct (int int)))))
    (
        memory-store
        pointer=(local "closurePointer__f__0")
        layout=(struct (function-ptr (struct (int int))))
        offset=(0)
        value=(function-ptr "shed__function__f__0")
    )
    (data-ptr-to-int (local "closure__f__0") (local "closurePointer__f__0"))
    (
        memory-store
        pointer=(local "closurePointer__f__0")
        layout=(struct (function-ptr (struct (int int))))
        offset=(1 0)
        value=(local "local__a")
    )
    (
        memory-store
        pointer=(local "closurePointer__f__0")
        layout=(struct (function-ptr (struct (int int))))
        offset=(1 1)
        value=(local "local__b")
    )
)

Temporary stack:
 * closure__f__0